#ifndef J3DMODEL_H
#define J3DMODEL_H

#include <QObject>
#include "QGLViewer/qglviewer.h"
#include "STLModel.h"

class JGLWidget;

class J3DModel : public QObject
{
	Q_OBJECT

public:
	J3DModel(JGLWidget* glwidget, const QString& filename);
	~J3DModel();

public slots:
	void draw();
	void play();
	void reset();
	void stop();
	void pause();
	void loop();
	//void setSpeed(int playSpeed);

private:
	STLModel m_Model;
	GLuint m_ModelDisplayList;

	bool m_bShow;
	bool m_bLoop;

	JGLWidget *m_pGLWidget;

	qglviewer::ManipulatedFrame** keyFrame_;
	qglviewer::KeyFrameInterpolator kfi_;
	int nbKeyFrames;
	int currentKF_;
	
};

#endif // J3DMODEL_H
